package com.dd.cloud.common.annotate;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.dd.cloud.common.serializer.FileSuffixDeserializer;
import com.dd.cloud.common.serializer.FileSuffixSerializer;

import java.lang.annotation.*;

/**
 * 文件服务器注解 添加文件服务器路径
 *
 * @author: czg
 * @date:2022/01/04
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@JacksonAnnotationsInside
@JsonDeserialize(using = FileSuffixDeserializer.class)
@JsonSerialize(using = FileSuffixSerializer.class)
public @interface FileSuffix {
    //是否需要文件域名
    boolean head() default true;

    /**
     * 入参是否删除 url前缀
     *
     * @return
     */
    boolean inDelete() default true;

    /**
     * 出参是否追加 url前缀
     *
     * @return
     */
    boolean outAppend() default true;
}
